package cn.ecnu.paper.mapper;

import cn.ecnu.paper.pojo.Refer;
import cn.ecnu.paper.vo.ReferVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ReferMapper {

    @Insert("INSERT INTO refer(referer_id, refered_id) VALUES (#{refererId}, #{referedId})")
    int insertRefer(Refer refer);

    List<ReferVo> getReferVo(Integer paperId);

    @Delete("DELETE FROM refer WHERE referer_id = #{paperId}")
    int deleteReferByRefererId(@Param("paperId") Integer paperId);
}
